import { defineComponent, getCurrentInstance } from "vue";

let proxy
export default defineComponent(
  {
    data () {
      return {
  
      }
    },
    watch: {
      // watch
    },
    created () {
      proxy = getCurrentInstance().proxy;
    },
    mounted () {
      // mounted
    },
    methods: {
      // 标会测试
      onSolDataTest () {
        // 测试方案转图形
        proxy.solZoomByName('广西壮族自治区', '南宁市', '清秀区') // '山东省', '泰安市')'北京市', '北京市', '海淀区'
        proxy.solDataTest() // 测试！
      },
      onSolDataTest2 () {
        // 测试方案转图形
        // proxy.solZoomByName('广西壮族自治区', '南宁市', '清秀区') // '山东省', '泰安市')'北京市', '北京市', '海淀区'
        proxy.solDataTest2() // 测试！
      },
      onSolDataUpdateTest () {
        proxy.solDataUpdateTest()
      },
  
      onSelected () {
        console.log('测试数据，如果开看到；注意删除')
        // proxy.$refs.iPlotting.setPlotType()
        proxy.iActType = proxy.selTest
        proxy.$refs.iPlotting.getPlotData(proxy.iActType) // 调用plottinglayer方法，其内部使用vec的get-PlotDataEx方法
        proxy.$refs.iPlotting.setPlotType(proxy.selTest)
      },
      // 方案测试--数据结构原来的 - 过时
      // solDataTest_0ld () {
      //   const solDataX = [[
      //     { sPlotID: 'icon_lu', aPnts: [[116.2, 39.9]], aUnit: [1000, 1000], sTxt: '', oPop: { name: '张三' } },
      //     // { sPlotID: 'ddir_bm_zydwzzk', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
      //     { sPlotID: 'dire_bm_dir', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
      //     { sPlotID: 'dire_bm_fajjd', aPnts: [[116.283662, 39.88856]], aUnit: [1000, 1000] },
      //     { sPlotID: 'dire_bm_fassd', aPnts: [[116.283662, 39.800021]], aUnit: [1000, 1000] },
      //     { sPlotID: 'mult_dashArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aUnit: [1000, 1000], sTxt: '疏散2000人' }, // mult_getSSArrowPnts mult_getSimpleArrowEW
      //     { sPlotID: 'mult_dashPathArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aPathPnts: [[116.284399, 39.881778], [116.247389, 39.864778], [116.242789, 39.857467], [116.219505, 39.825778], [116.199958, 39.792522]], aUnit: [1000, 1000], sTxt: '疏散2000人' } // mult_dashPathArrowPnts mult_pathArrowPnts
      //   ]
      //   ]
      //   proxy.solData2Plot(solDataX, 12, [1000, 1000], '#ff0000')
      // },
  
      // 方案测试--数据结构原来的 - 过时
      // solDataTest_old () {
      //   const solDataX = [
      //     [
      //       { sPlotID: 'icon_lu', aPnts: [[116.2, 39.9]], aUnit: [1000, 1000], sTxt: '', oPop: { name: '张三' } },
      //       // { sPlotID: 'ddir_bm_zydwzzk', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
      //       { sPlotID: 'dire_bm_dir', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
      //       { sPlotID: 'dire_bm_fajjd', aPnts: [[116.283662, 39.88856]], aUnit: [1000, 1000] },
      //       { sPlotID: 'dire_bm_fassd', aPnts: [[116.283662, 39.800021]], aUnit: [1000, 1000] },
      //       { sPlotID: 'mult_dashArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aUnit: [1000, 1000], sTxt: '疏散2000人' }, // mult_getSSArrowPnts mult_getSimpleArrowEW
      //       { sPlotID: 'mult_dashPathArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aPathPnts: [[116.284399, 39.881778], [116.247389, 39.864778], [116.242789, 39.857467], [116.219505, 39.825778], [116.199958, 39.792522]], aUnit: [1000, 1000], sTxt: '疏散2000人' } // mult_dashPathArrowPnts mult_pathArrowPnts]
      //     ], [
      //       { sPlotID: 'icon_lu', aPnts: [[116.2, 39.9]], aUnit: [1000, 1000], sTxt: '', oPop: { name: '王武' } },
      //       // { sPlotID: 'ddir_bm_zydwzzk', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
      //       { sPlotID: 'dire_bm_dir', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
      //       { sPlotID: 'dire_bm_fajjd', aPnts: [[116.283662, 39.88856]], aUnit: [1000, 1000] },
      //       { sPlotID: 'dire_bm_fassd', aPnts: [[116.283662, 39.800021]], aUnit: [1000, 1000] },
      //       { sPlotID: 'mult_dashArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aUnit: [1000, 1000], sTxt: '疏散2000人' }, // mult_getSSArrowPnts mult_getSimpleArrowEW
      //       { sPlotID: 'mult_dashPathArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aPathPnts: [[116.284399, 39.881778], [116.247389, 39.864778], [116.242789, 39.857467], [116.219505, 39.825778], [116.199958, 39.792522]], aUnit: [1000, 1000], sTxt: '疏散2000人' } // mult_dashPathArrowPnts mult_pathArrowPnts]
      //     ]
      //   ]
      //   proxy.solData2Plot(solDataX, 12, [1000, 1000], '#ff0000')
      // },
  
      // 测试数据添加了唯一标识，原来的转成成类型sPlotType
      solDataTest () {
        const solDataX = [
          // [
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'icon_lu', aPnts: [[116.2, 39.9]], aUnit: [1000, 1000], sTxt: '', oPop: { name: '张三' } },
          //   // { sPlotID: 'cy1-370911370911109', sPlotType: 'ddir_bm_zydwzzk', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911110', sPlotType: 'dire_bm_dir', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911111', sPlotType: 'dire_bm_fajjd', aPnts: [[116.283662, 39.88856]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911112', sPlotType: 'dire_bm_fassd', aPnts: [[116.283662, 39.800021]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911113', sPlotType: 'mult_dashArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aUnit: [1000, 1000], sTxt: '疏散2000人' }, // mult_getSSArrowPnts mult_getSimpleArrowEW
          //   { sPlotID: 'cy1-370911370911114', sPlotType: 'mult_dashPathArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aPathPnts: [[116.284399, 39.881778], [116.247389, 39.864778], [116.242789, 39.857467], [116.219505, 39.825778], [116.199958, 39.792522]], aUnit: [1000, 1000], sTxt: '疏散2000人' } // mult_dashPathArrowPnts mult_pathArrowPnts]
          // ], [
          //   { sPlotID: 'cy1-370911370911115', sPlotType: 'icon_lu', aPnts: [[116.2, 39.9]], aUnit: [1000, 1000], sTxt: '', oPop: { name: '王武' } },
          //   { sPlotID: 'cy1-370911370911116', sPlotType: 'ddir_bm_zydwzzk', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
          //   // { sPlotID: 'cy1-370911370911116', sPlotType: 'dire_bm_dir', aPnts: [[116.2, 39.9], [116.1, 39.8]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911117', sPlotType: 'dire_bm_fajjd', aPnts: [[116.283662, 39.88856]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911118', sPlotType: 'dire_bm_fassd', aPnts: [[116.283662, 39.800021]], aUnit: [1000, 1000] },
          //   { sPlotID: 'cy1-370911370911119', sPlotType: 'mult_dashArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aUnit: [1000, 1000], sTxt: '疏散2000人' }, // mult_getSSArrowPnts mult_getSimpleArrowEW
          //   { sPlotID: 'cy1-370911370911120', sPlotType: 'mult_dashPathArrowPnts', aPnts: [[116.283662, 39.88856], [116.283662, 39.800021]], aPathPnts: [[116.284399, 39.881778], [116.247389, 39.864778], [116.242789, 39.857467], [116.219505, 39.825778], [116.199958, 39.792522]], aUnit: [1000, 1000], sTxt: '疏散2000人' } // mult_dashPathArrowPnts mult_pathArrowPnts]
          // ]
          // -- 路径规划
          // [
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'icon_cp_qyfw', aPnts: [[108.352368, 22.802328]], aUnit: [1000, 1000], sTxt: '', oPop: { name: '调整点' } },
          //   { sPlotID: 'cy1-370911370911127', sPlotType: 'route', aPnts: [[108.352368, 22.802328], [108.352522, 22.802131], [108.353052, 22.801456]], aUnit: [1000, 1000], sTxt: '青山路' },
          //   { sPlotID: 'cy1-370911370911128', sPlotType: 'route', aPnts: [[108.353052, 22.801456], [108.353504, 22.801029], [108.354089, 22.800608]], aUnit: [1000, 1000], sTxt: '青山路' },
          //   { sPlotID: 'cy1-370911370911129', sPlotType: 'route', aPnts: [[108.354089, 22.800608], [108.355402, 22.799764], [108.355689, 22.799548], [108.356037, 22.799279], [108.356487, 22.798947], [108.356876, 22.798661], [108.357508, 22.79837], [108.357981, 22.79817], [108.36045, 22.797042]], aUnit: [1000, 1000], sTxt: '青竹立交', sColor: '#00ff00' },
          //   { sPlotID: 'cy1-370911370911130', sPlotType: 'route', aPnts: [[108.367881, 22.782238], [108.367778, 22.781566], [108.367594, 22.780701], [108.366985, 22.777678], [108.366957, 22.777523], [108.366824, 22.776781], [108.366716, 22.775999], [108.366585, 22.774845], [108.366445, 22.774042], [108.366409, 22.773782], [108.366298, 22.773043], [108.366247, 22.77253], [108.366249, 22.772331], [108.366252, 22.771854], [108.366258, 22.771603], [108.366299, 22.771006], [108.366339, 22.770787], [108.366371, 22.770581], [108.366528, 22.769851], [108.36669, 22.769215], [108.366908, 22.768361], [108.367319, 22.766922], [108.367862, 22.765722], [108.369173, 22.763917], [108.369506, 22.763528], [108.369803, 22.763181], [108.370042, 22.762941], [108.370638, 22.762341], [108.371257, 22.761825], [108.372087, 22.761131], [108.3744, 22.7592], [108.375158, 22.758453], [108.37527, 22.758342], [108.375405, 22.758219], [108.375908, 22.75776], [108.376723, 22.756942], [108.377049, 22.756563], [108.37746, 22.756034], [108.377771, 22.755635], [108.3784, 22.754673], [108.378567, 22.754328], [108.378954, 22.75353], [108.379217, 22.752854], [108.379406, 22.752142], [108.379595, 22.751291], [108.37969, 22.750655], [108.379715, 22.750028], [108.379705, 22.749493], [108.379686, 22.748854], [108.37965, 22.74736], [108.379668, 22.745424]], aUnit: [1000, 1000], sTxt: '青山路X' },
          //   { sPlotID: 'cy1-370911370911131', sPlotType: 'route', aPnts: [[108.47684, 22.760348], [108.476699, 22.760055], [108.476443, 22.758626], [108.476443, 22.758626], [108.476405, 22.758412], [108.476542, 22.758412], [108.476918, 22.758403], [108.477276, 22.75841], [108.477625, 22.758421], [108.479368, 22.758599], [108.47987, 22.75865], [108.481166, 22.758807], [108.481287, 22.758816], [108.481397, 22.758824], [108.481618, 22.758809], [108.481893, 22.758766], [108.482663, 22.758608], [108.48348, 22.758455], [108.484564, 22.75822], [108.484771, 22.758179], [108.485081, 22.758215], [108.485081, 22.758215], [108.485236, 22.758127], [108.485328, 22.758063], [108.48545, 22.757974], [108.485744, 22.757771], [108.485945, 22.757636], [108.486801, 22.757225], [108.487338, 22.756972], [108.487815, 22.756652], [108.488119, 22.756417], [108.48844, 22.756219], [108.488762, 22.756048], [108.48903, 22.755907], [108.489218, 22.755731], [108.489384, 22.755543], [108.489526, 22.755325], [108.489737, 22.754815], [108.489757, 22.754692], [108.489939, 22.754457], [108.490159, 22.754127], [108.490397, 22.754011], [108.490539, 22.753905], [108.490642, 22.753765], [108.490724, 22.753644]], aUnit: [1000, 1000], sTxt: '测试123213', sColor: '#00ffff' },
          //   { sPlotID: 'route_cy1-370911370911130', sPlotType: 'updatePlotTxtInfo', aPnts: ['add'], sTxt: 'del test' },
          //   { sPlotID: 'route_cy1-370911370911130', sPlotType: 'updatePlotTxtInfo', aPnts: ['add'], sTxt: 'new text string' },
          //   { sPlotID: 'route_cy1-370911370911130', sPlotType: 'updatePlotTxtInfo', aPnts: ['replace'], sTxt: 'replace test' },
          //   { sPlotID: 'route_cy1-370911370911130', sPlotType: 'updatePlotTxtInfo', aPnts: ['del'], sTxt: 'replace test' }
          // ]
          // -- 气泡更新
          // [
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'icon_bl_fkjbzhs', aPnts: [[108.352368, 22.802328]], aUnit: [1000, 1000], sTxt: 'test', oPop: { name: '调整点' } },
          //   // { sPlotID: 'cy1-370911370911109', sPlotType: 'icon_cp_qyfw', aPnts: [[108.352368, 22.802328]], aUnit: [1000, 1000], sTxt: '' },
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'updatePlotPopInfo', oPop: { age: 18 } },
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'updatePlotPopInfo', aPnts: ['add'], oPop: { class: '62', dep: 'x-1' } },
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'updatePlotPopInfo', aPnts: ['del'], oPop: { class: '55' } },
          //   { sPlotID: 'cy1-370911370911109', sPlotType: 'updatePlotPopInfo', aPnts: ['del'], oPop: { xid: '62' } },
          //   // { sPlotID: 'icon_cy1-370911370911109', sPlotType: 'updatePlotTxtInfo', aPnts: ['add'], sTxt: 'new text string' },
          //   // { sPlotID: 'icon_cy1-370911370911109', sPlotType: 'updatePlotTxtInfo', aPnts: ['add'], sTxt: 'del test' },
          //   // { sPlotID: 'icon_cy1-370911370911109', sPlotType: 'updatePlotTxtInfo', aPnts: ['replace'], sTxt: 'replace test' }
          // ]
          // -- 数据库保存测试 --
          // [
          //   {
          //     sPlotID: '1661149631955source450103',
          //     sPlotType: 'dire_bm_fajjd',
          //     aPnts: [
          //       [
          //         108.50144,
          //         22.79223
          //       ]
          //     ],
          //     aUnit: [
          //       1500,
          //       1500
          //     ]
          //   },
          //   {
          //     sPlotID: 'PLOT_1661323131',
          //     sPlotType: 'mult_dashArrowPnts',
          //     aPnts: [
          //       [
          //         108.50144,
          //         22.79223
          //       ],
          //       [
          //         108.79477,
          //         22.76656
          //       ]
          //     ],
          //     aUnit: [
          //       1500,
          //       1500
          //     ],
          //     sTxt: '疏散999人'
          //   },
          //   {
          //     sPlotID: '1661149631955areaSSDY-4501-0003',
          //     sPlotType: 'dire_bm_fassd',
          //     aPnts: [
          //       [
          //         108.79477,
          //         22.76656
          //       ]
          //     ],
          //     aUnit: [
          //       1500,
          //       1500
          //     ]
          //   }
          // ]
          // -- 数据库保存结束
          [
            {
              sPlotID: 'PLOT_1661323131',
              sPlotType: 'icon_cp_zydyl',
              aPnts: [
                [
                  120.392,
                  36.1137
                ]
              ],
              aUnit: [
                1000,
                1000
              ],
              sTxt: '',
              oPop: {
                医护人员: '3人'
              }
            },
            {
              sPlotID: 'icon_PLOT_1661323131', // 这里使用的是元素ID element_id
              sPlotType: 'updatePlotPopInfo',
              aPnts: [
                'add'
              ],
              oPop: {
                宣传保障: '宣传保障人员: 1人'
              }
            }
            // -- 拆成两部分测试
            // {
            //   sPlotID: 'icon_PLOT_1661323131', // 这里使用的是元素ID element_id
            //   sPlotType: 'updatePlotPopInfo',
            //   aPnts: [
            //     'add'
            //   ],
            //   oPop: {
            //     治安保障: '治安人员: 2人',
            //     测试: '123eng中文'
            //   }
            // }
          ]
        ]
        proxy.solData2Plot(solDataX, 12, [100, 100], '#ff0000')
      },
      solDataTest2 () {
        const solDataX = [
          [
            {
              sPlotID: 'icon_PLOT_1661323131', // 这里使用的是元素ID element_id
              sPlotType: 'updatePlotPopInfo',
              aPnts: [
                'add'
              ],
              oPop: {
                治安保障: '治安人员: 2人',
                测试: '123eng中文'
              }
            }
          ]
        ]
        proxy.solData2Plot(solDataX, 12, [100, 100], '#ff0000')
      },
  
      solDataUpdateTest () {
        const solDataX = [
          [
            {
              sPlotID: 'mult_PLOT_1661323131', // 'mult_1661414671942arrow3702026sLE8B92iNtHAAv4vj7E',
              sPlotType: 'updatePlotTxtInfo',
              aPnts: [
                [
                  120.389,
                  36.0763
                ],
                [
                  119.717,
                  36.6261
                ]
              ],
              aUnit: [
                1500,
                1500
              ],
              sTxt: '修改数据124'
            },
            { sPlotID: 'mult_PLOT_1661323131_0', sPlotType: 'updatePlotPopInfo', oPop: { age: 18 } }
          ]
        ]
        proxy.solData2Plot(solDataX, 12, [1000, 1000], '#ff0000')
      },
  
      // 开启标绘功能
      /* Method: startPlotting
      * 开启标绘功能
      * 参数iBoolean ：true 启动，false关闭
      */
      startPlotting (iBoolean) {
        if (iBoolean) {
          if (proxy.$refs.iPlotting.hasPlottingLayer()) {
            proxy.iAction = 'Plotting'
            proxy.iActType = null // 'Star'
            proxy.clearSelectZone() // 清除鼠标选择区域(边界线)
            proxy.$refs.iPlotting.setPlotType(proxy.iActType)
            proxy.$refs.iPlotting.setPlotColor(proxy.selColor)
            proxy.$refs.iPlotting.addInteraction()
            proxy.$refs.iPlotting.openPlotPanel() // 打开标绘面板
            // console.log('goto plotting')
          } else {
            proxy.iAction = 'Plotting'
            proxy.iActType = null // 'Star'
            
            proxy.clearSelectZone() // 清除鼠标选择区域(边界线)
            proxy.$refs.iPlotting.startPlotting(proxy.imap)
            proxy.$refs.iPlotting.setPlotType(proxy.iActType)
            proxy.$refs.iPlotting.setPlotColor(proxy.selColor)
            // proxy.$refs.iPlotting.iType = 'Star'
            proxy.$refs.iPlotting.addInteraction()
          }
        } else {
          // proxy.iAction = null
          proxy.$refs.iPlotting.stopPlotting()
        }
        proxy.imap.getOverlays().clear() // 清空所有闪烁和气泡
      },
  
      /**
       * @description 使用数据添加军标
       * @param oSolData [{Object}]方案数据数组, nMapLevel {number} 地图级别, aUnit {Array}军标尺寸（米）, sColor军标颜色(缺省为红色), cls {boolean} 是否清除原有数据，默认清空
       * @return 无sPlotID, aPnts, aUnit, sColor = '#ff0000', cls = true
       */
      async solData2Plot_old (oSolData, nMapLevel, aUnit, sColor) {
        let iZoom = 12
        if (nMapLevel) {
          if (nMapLevel > 12) {
            iZoom = nMapLevel
          }
        }
        // const iZoom = nMapLevel || 12
        const iUnit = aUnit || [500, 500]
        const iColor = sColor || '#ff0000'
        // 将地图显示到指定级别
        // const nLv = proxy.imap.getView().getZoom() // 获得当前地图级别
        // if (iZoom > nLv) {
        //   proxy.imap.getView().animate({ zoom: iZoom })
        //   await proxy.sleep(1000) // 延迟
        // }
  
        proxy.imap.getView().animate({ zoom: iZoom })
        await proxy.sleep(1000)
        if (proxy.$refs.iPlotting.hasPlottingLayer()) {
          // if (iClear) proxy.clearData()
        } else {
          proxy.$refs.iPlotting.initPlottingLayer(proxy.imap)
        }
        // 设置颜色
        proxy.$refs.iPlotting.setPlotColor(iColor)
        // 设定单位
        proxy.$refs.iPlotting.setUnit(iUnit[0], iUnit[1])
        proxy.iAction = 'Plotting'
        // proxy.$refs.iPlotting.setPlotType(proxy.iActType) // -- 不是指绘画类型727
  
        // const aPlotIDLs = ['dire_bm_fajjd', 'dire_bm_fassd']
        // let x, y
        // for (let i = 0; i < aPlotIDLs.length; i++) {
        //   proxy.iActType = aPlotIDLs[i]
        //   x = 0 + 2000 * i
        //   y = 0 + 2000 * i
        //   proxy.$refs.iPlotting.data2plot(aPlotIDLs[i], [x, y], [1000, 1000])
        // }
  
        // proxy.iAction = 'Plotting'
        // proxy.$refs.iPlotting.setPlotType(proxy.iActType)
        // proxy.iActType = 'dire_bm_fajjd'
        // proxy.$refs.iPlotting.data2plot('dire_bm_fajjd', [[0, 0]], [1000, 1000])
  
        // // proxy.$refs.iPlotting.data2plot('dire_bm_fassd', [[2000, 2000]], [1000, 1000])
        // proxy.iActType = 'dire_bm_fajjd'
        // proxy.$refs.iPlotting.data2plot('dire_bm_fassd', [[0, 0]], [1000, 1000])
        proxy.$refs.iPlotting.solData2Plot(oSolData)
        proxy.$refs.iPlotting.stopPlotting()
        proxy.$emit('sol2plotFin')
      },
  
      /**
       * @description 使用数据添加军标
       * @param aSolData {Array}方案数据数组,如： [[{方案数据1},{方案数据2}],[{...}]]； nMapLevel {number} 地图级别, aUnit {Array}军标尺寸（米）, sColor军标颜色(缺省为红色), cls {boolean} 是否清除原有数据，默认清空
       * @return 无  --   sPlotID, aPnts, aUnit, sColor = '#ff0000', cls = true
       */
      async solData2Plot (aSolData, nMapLevel, aUnit, sColor) {
        let iZoom = 12
        // console.log(typeof aSolData)
        const iUnit = aUnit || [500, 500]
        const iColor = sColor || '#ff0000'
        if (nMapLevel) {
          if (nMapLevel > 11) {
            iZoom = nMapLevel
          }
        }
        // 将地图显示到指定级别 -- 环境初始化
        proxy.imap.getView().animate({ zoom: iZoom })
        // 设置颜色
        proxy.$refs.iPlotting.setPlotColor(iColor)
        // 设定单位
        proxy.$refs.iPlotting.setUnit(iUnit[0], iUnit[1])
        proxy.iAction = 'Plotting'
        await proxy.sleep(1000)
        // console.log('###########################################################', aSolData.length)
        for (let i = 0; i < aSolData.length; i++) { // 分析方案中的每一个数据组
          const a = aSolData[i]
          // console.log('###########################################################', a)
          proxy.$refs.iPlotting.solData2Plot(a) // 修改了sol4plotting中的solDataPlot-->data2plot方法
          // proxy.$refs.iPlotting.stopPlotting() // 关闭标绘
        }
        proxy.$refs.iPlotting.stopPlotting() // 关闭标绘
        proxy.$emit('sol2plotFin')
  
        // // const iZoom = nMapLevel || 12
        // const iUnit = aUnit || [500, 500]
        // const iColor = sColor || '#ff0000'
        // // 将地图显示到指定级别
        // // const nLv = proxy.imap.getView().getZoom() // 获得当前地图级别
        // // if (iZoom > nLv) {
        // //   proxy.imap.getView().animate({ zoom: iZoom })
        // //   await proxy.sleep(1000) // 延迟
        // // }
  
        // proxy.imap.getView().animate({ zoom: iZoom })
        // await proxy.sleep(1000)
        // if (proxy.$refs.iPlotting.hasPlottingLayer()) {
        //   // if (iClear) proxy.clearData()
        // } else {
        //   proxy.$refs.iPlotting.initPlottingLayer(proxy.imap)
        // }
        // // 设置颜色
        // proxy.$refs.iPlotting.setPlotColor(iColor)
        // // 设定单位
        // proxy.$refs.iPlotting.setUnit(iUnit[0], iUnit[1])
        // proxy.iAction = 'Plotting'
  
        // proxy.$refs.iPlotting.solData2Plot(oSolData)
        // proxy.$refs.iPlotting.stopPlotting()
      },
  
      /**
       * @description 根据行政区域名称,缩放到合适位置
       * @param sProvince {String}省份； sCity {String}市； sArea {String}区
       * @return
       */
  
      async solZoomByName (sProvince, sCity = null, sArea = null) {
        const aBBox = await proxy.getBBoxByName(sProvince, sCity, sArea) // 返回'EPSG:4326'bbox
        // console.log(aBBox)
        if (!aBBox) return null
        // let aCent = [(aBBox[0] + aBBox[2]) / 2, (aBBox[1] + aBBox[3]) / 2,]
        // await proxy.sleep(500)
  
        // const cp1 = olProj.transform([aBBox[0], aBBox[1]], 'EPSG:4326', proxy.conf.RCS)
        // const cp2 = olProj.transform([aBBox[2], aBBox[3]], 'EPSG:4326', proxy.conf.RCS)
        // console.log(cp1, cp2)
        // proxy.boxZoom([cp1[0], cp1[1], cp2[0], cp2[1]])
        proxy.boxZoom(aBBox)
      },
  
      /**
       * @description 根据给定的军标ID删除军标
       * @param sPlotID {军标的ID}
       * @return
       */
      delPlotByID (sPlotID) {
        proxy.$refs.iPlotting.delPlot(sPlotID)
      },
  
      /**
       * @description 根据给定的军标ID获取军标数据（标绘数据结构）
       * @param sPlotID {军标的ID}
       * @return
       */
      getPlotByID (sPlotID) {
        return proxy.$refs.iPlotting.getPlotFromXData(sPlotID)
      },
  
      /**
       * @description 根据给定的军标ID删除军标--数组参数，批量
       * @param sPlotID {军标的ID}
       * @return
       */
      delPlotEX (PlotID) {
        if (Array.isArray(PlotID)) {
          for (let i = 0; i < PlotID.length; i++) {
            proxy.$refs.iPlotting.delPlot(PlotID[i])
          }
        } else if (typeof PlotID === 'string') {
          // console.log(typeof PlotID === 'string')
          proxy.$refs.iPlotting.delPlot(PlotID)
        }
      }
  
      // 当前方法
    }
  }
  
)